import { createApp } from 'vue'
import App from './views/app/App.vue'

// 引入权限控制
import './permission.js'
import './directive'

// 引入 样式
import './styles/index.scss'
import 'animate.css'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets

// 引入 store router
import store from './store'
import router from './router'

// 引入 ElementPlus
// import './styles/element/index.scss'
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css'
import './styles/dark/css-vars.scss'
// import 'element-plus/theme-chalk/src/dark/css-vars.css'
import * as ElIcons from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import "default-passive-events"

// 引入 utils
import * as utils from './utils'
import * as filters from './utils/filters'
import * as constant from './utils/constant'
import rules from './utils/rules'
import $Request from './api'
import config from '@/env'

// 引入 ElIcons
let app = createApp(App)
for (let iconName in ElIcons) {
    app.component(iconName, ElIcons[iconName])
}

// init
app.config.globalProperties = { utils, $Request, config, filters, constant, rules }
app.use(store).use(router).use(ElementPlus, { zIndex: 3000, locale: zhCn }).mount('#app')
